<?php require 'common/header.php';?>
<?php require 'common/left.php';?>
<div id="main-content">
  <h2>欢迎您 <?php echo $_COOKIE['adminname'];?></h2>
  <p id="page-intro">漏洞类型管理。</p>
  <div class="clear"></div>
  <div class="content-box">
    <div class="content-box-header">
      <h3>漏洞类型管理</h3>
      <ul class="content-box-tabs">
      	 <li><a href="<?php echo Qtpl::createUrl('cate', 'index','','admin');?>">类型管理</a></li>
         <li><a href="<?php echo Qtpl::createUrl('cate', 'show','','admin');?>" class="default-tab">添加类型</a></li>
	  </ul>
      <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
          <div class="form">
              <form action="<?php echo Qtpl::createUrl('cate', 'show','','admin');?>" method="post" id="js-form">
                	<fieldset class="clearfix">
                      <input type="hidden" name="token" value="<?php echo $_tpl['token'];?>" />
                      <input type="hidden" name="cid" value="<?php echo $_tpl['cate']['cid'];?>" />
                      <p><label><?php echo $_tpl['hname'];?>类型：</label>
                        <span><select id="one" name="pid">
                        <option value="0">-----顶级类型-----</option>
                        <?php 
                        foreach ($_tpl['p'] as $v){
                        	$selected = $v['cid'] == $_tpl['cate']['pid'] ? "selected" : "";
                        	echo "<option value='{$v['cid']}'{$selected}>{$v['cate_name']}</option>";
                        }
                        ?>
                        </select></span>
                        </p>
                        <p><label><font class="red"> * </font>类型名称：</label>
                        <span><input type="text" value="<?php echo $_tpl['cate']['cate_name'];?>" class="text-input small-input" name="cate_name" /></span>
                        </p>
                  <dt>
                    <input type="submit" name="" id="button" class="button" value="<?php echo $_tpl['hname'];?>" />
                  </dt>
                </fieldset>
              </form>
            </div>
        </div>
      </div>
  </div>
<?php require 'common/footer.php';?>